<?php

/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

 require_once($_SERVER['DOCUMENT_ROOT'].'/ukkepuk/source/php/classes/service/CalendarService.php');
	
   $calendarService = new CalendarService();
   
   echo "<div class=\"calendarkids\">";
   echo "<div class=\"tabhead\">Ma</div>";
   echo "<div class=\"tabhead\">Di</div>";
   echo "<div class=\"tabhead\">Wo</div>";
   echo "<div class=\"tabhead\">Do</div>";
   echo "<div class=\"tabhead\">Vr</div>";
   echo "<div class=\"tabhead\">Za</div>";
   echo "<div class=\"tabhead\">Zo</div>";
   $i = 1;
   
   $keytoday = date("Ymd");
 
   foreach($calendarService->readKidsCommingThisMonth() as $calendarKids){
      
       echo "<div class=\"datecell\">";
       
       echo "<div class=\"back ";
       if($calendarKids->getDate() == $keytoday)
           echo "today ";
       else
           echo $calendarKids->getItemType()." ";
       if($i >= 6)
           echo "we";
       echo "\">".substr($calendarKids->getDate(),6)."</div>";
       echo "<div class=\"front\">";
       foreach($calendarKids->getKids() as $kid){
           echo $kid->getName() . " " . $kid->getFirstName() ."</br>";
       }
       echo "</div>";
       echo "</div>";
       
       if($i == 7)
           $i = 0;
       
       $i++;
   }
   
   echo "</div>";
   
?>
